package com.wyc.apidriver.feign;

import com.wyc.internalCommon.request.OrderInfo;
import com.wyc.internalCommon.result.ApiResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient("service-order")
public interface OrderFeignClient {

    /**
     * 司机出发去接乘客
     * @param orderInfo
     * @return
     */
    @PostMapping("/order/to-pick-up-passenger")
    ApiResult toPickUpPassenger(@RequestBody OrderInfo orderInfo);

    /**
     * 司机到达上车地点
     * @param id
     * @return
     */
    @GetMapping("/order/driver-arrived-departure")
    ApiResult driverArrivedDeparture(@RequestParam Long id);

    /**
     * 司机接到乘客
     * @param orderInfo
     * @return
     */
    @PostMapping("/order/pick-up-passenger")
    ApiResult pickUpPassenger(@RequestBody OrderInfo orderInfo);

    /**
     * 乘客下车，行程结束
     * @param orderInfo
     * @return
     */
    @PostMapping("/order/passenger-getoff")
    ApiResult passengerGetoff(@RequestBody OrderInfo orderInfo);

    /**
     * 取消订单
     * @param orderId
     * @param identity 取消人的身份标识（1.乘客 2.司机3.平台）
     * @return
     */
    @PostMapping("/order/cancel")
    ApiResult cancelOrder(@RequestParam("orderId") Long orderId, @RequestParam("identity") String identity);


}
